/**
 * Created by Neville Kadwa.
 */
package org.shiftone.cdep.browser.server;

import java.util.Map;

public abstract class DataTypesUtil
{

    public static int getInt(Map map, String key)
    {
        Integer value = (Integer) map.get(key);
        if (value == null)
            return 0;
        return value.intValue();
    }

    public static Integer getInteger(Map map, String key)
    {
        return (Integer) map.get(key);
    }

    public static String getString(Map map, String key)
    {
        return (String) map.get(key);
    }

    public static boolean getBool(Map map, String key)
    {
        Boolean value = (Boolean) map.get(key);
        if (value == null)
            return false;
        return value.booleanValue();
    }

    public static Boolean getBoolean(Map map, String key)
    {
        return (Boolean) map.get(key);
    }
}
